package de.szut.ita13sommerfeld.blockadventure.gameentities.blocks;

import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.util.LinkedList;

import de.szut.ita13sommerfeld.blockadventure.gameentities.Block;
import de.szut.ita13sommerfeld.blockadventure.gameentities.Entity;
import de.szut.ita13sommerfeld.blockadventure.gameentities.types.BlockType;
import de.szut.ita13sommerfeld.blockadventure.level.SpawnPoint;

public class CheckPoint extends Block {
	
	private BufferedImage[] tex = new BufferedImage[2];
	
	private int status;
	
	public CheckPoint(float x, float y, float width, float height, SpawnPoint spawnpoint) {
		super(x, y, width, height, spawnpoint);
		tex[0] = texture.getBlockTexture(BlockType.CheckPoint);
		tex[1] = texture.getBlockTexture(BlockType.CheckPointSet);
		status = 0;
	}


	public void render(Graphics g) {
		g.drawImage(tex[status], (int)x,(int)y, null);
	}


	public void tick(LinkedList<Entity> entities) {
		
	}

	public Rectangle getBounds() {
		return new Rectangle((int)x, (int)y, (int)width, (int)height);
	}
	
	public Rectangle getBottomBounds() {
		return new Rectangle((int)x + 5, (int)y + (int)(height - 5), (int)width - 10, (int)5);
	}

	public Rectangle getBoundsTop() {
		return new Rectangle((int)x + 5, (int)y, (int)width - 10, (int)5);
	}

	public Rectangle getBoundsRight() {
		return new Rectangle((int)(x + width - 5), (int)y + 5, (int)5, (int)height - 10);
	}

	public Rectangle getBoundsLeft() {
		return new Rectangle((int)x, (int)y + 5, (int)5, (int)height - 10);
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

}
